#ifndef ALARMALERTTONE_H
#define ALARMALERTTONE_H

#include <QMainWindow>
#include <QMediaPlayer>
#include <QUrl>
#include<QTimer>
namespace Ui {
class AlarmAlertTone;
}

const QString soundPath="F:\\Graduation_project\\WorkPlace\\work-place\\Vegetable_greenhouse_control_system\\res\\";

const QString soundSet[10]={"Alarm01.mp3","Alarm02.mp3","Alarm03.mp3","Alarm04.mp3","Alarm05.mp3","Alarm06.mp3","Alarm07.mp3","Alarm08.mp3","Alarm09.mp3","Alarm10.mp3"};
class AlarmAlertTone : public QMainWindow
{
    Q_OBJECT

public:
    explicit AlarmAlertTone(QWidget *parent = nullptr);
    static AlarmAlertTone* instance();
    ~AlarmAlertTone();
private slots:
    void on_pushButtonConfirm_clicked();

    void on_pushButtonStop_clicked();

    void on_pushButtonPlay_clicked();

    void on_pushButtonExit_clicked();
    void playAlarmSound();

private:
void initAlarmAlertTone();
void switchPlayAlarm(int index,QString &soundSourcePath);
unsigned int& setVolume(unsigned int &volume);

private:
    Ui::AlarmAlertTone *ui;
    QMediaPlayer *player;
    QMediaPlayer *testPlayer;
    unsigned int volume;
    QTimer *stopTimer;

};

#endif // ALARMALERTTONE_H
